﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SensorNetworkUI
{
    public partial class Visualization : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Response.Write(SqlDataSource1.SelectCommand);
           
        }

        protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlDataSource1.SelectCommand = "SELECT [sensor_reading], [reading_date] FROM [Reading] where sensor_id = " + DropDownList1.SelectedValue;
            Response.Write(SqlDataSource1.SelectCommand);
            SqlDataSource1.Select(System.Web.UI.DataSourceSelectArguments.Empty);
            
            Chart1.DataBind();


        }
    }
}